module.exports = function(window, document) {
	var apivm = require('../../common/avm.min')(window, document);
	var avm = apivm;
	var api = apivm.api;
	var Component = apivm.Component;
	var $ = apivm.$;
	(function() {
	var Tabbar = /*@__PURE__*/ (function(Component) {
		function Tabbar(props) {
			Component.call(this, props);
			this.data = {};
		}

		if (Component) Tabbar.__proto__ = Component;
		Tabbar.prototype = Object.create(Component && Component.prototype);
		Tabbar.prototype.constructor = Tabbar;
		Tabbar.prototype.apiready = function() {};
		Tabbar.prototype.goPage = function(pagename) {
			var pagePath = {
				index: "../index/index",
				friend: "../friend/friend",
				addVideo: "../addVideo/addVideo",
				message: "../message/message",
				me: "../me/me"
			};

			// api.openWin({
			// 	name: pagename,
			// 	url: pagePath[pagename]
			// })
			wx.redirectTo({url: pagePath[pagename]});
		};
		Tabbar.prototype.render = function() {
			var this$1 = this;
			return apivm.h(
				"view",
				{class: "tabbar"},
				apivm.h(
					"view",
					{
						class: "tab-item",
						style: {color: this.props.active == "index" ? "#fff" : "#ccc"},
						onClick: function() {
							return this$1.goPage("index");
						}
					},
					"首页"
				),
				apivm.h(
					"view",
					{
						class: "tab-item",
						style: {color: this.props.active == "friend" ? "#fff" : "#ccc"},
						onClick: function() {
							return this$1.goPage("friend");
						}
					},
					"朋友"
				),
				apivm.h(
					"view",
					{
						class: "tab-item",
						onClick: function() {
							return this$1.goPage("addVideo");
						}
					},
					apivm.h("image", {src: "../../image/add.png"})
				),
				apivm.h(
					"view",
					{
						class: "tab-item",
						style: {color: this.props.active == "message" ? "#fff" : "#ccc"},
						onClick: function() {
							return this$1.goPage("message");
						}
					},
					"消息"
				),
				apivm.h(
					"view",
					{
						class: "tab-item",
						style: {color: this.props.active == "me" ? "#fff" : "#ccc"},
						onClick: function() {
							return this$1.goPage("me");
						}
					},
					"我"
				)
			);
		};

		return Tabbar;
	})(Component);
	apivm.define("tabbar", Tabbar);

	var Me = /*@__PURE__*/ (function(Component) {
		function Me(props) {
			Component.call(this, props);
			this.data = {
				works: [
					{
						id: 1,
						poster: "https://a415432669.github.io/shortvideo/poster0.jpg",
						playnum: "3.5w"
					},

					{
						id: 2,
						poster: "https://a415432669.github.io/shortvideo/poster1.jpg",
						playnum: "3.5w"
					},

					{
						id: 3,
						poster: "https://a415432669.github.io/shortvideo/poster2.jpg",
						playnum: "3.5w"
					},
					{
						id: 4,
						poster: "https://a415432669.github.io/shortvideo/poster3.jpg",
						playnum: "3.5w"
					},

					{
						id: 5,
						poster: "https://a415432669.github.io/shortvideo/poster4.jpg",
						playnum: "3.5w"
					}
				]
			};
		}

		if (Component) Me.__proto__ = Component;
		Me.prototype = Object.create(Component && Component.prototype);
		Me.prototype.constructor = Me;
		Me.prototype.apiready = function() {};
		Me.prototype.render = function() {
			return apivm.h(
				"view",
				{class: "page"},
				apivm.h(
					"view",
					{class: "header"},
					apivm.h("view", {class: "bg"}),
					apivm.h(
						"view",
						{class: "info"},
						apivm.h(
							"view",
							{class: "img"},
							apivm.h("image", {
								src: "https://a415432669.github.io/shortvideo/003.jpg"
							})
						),
						apivm.h(
							"view",
							{class: "infoList"},
							apivm.h(
								"view",
								{class: "info-item"},
								apivm.h("view", {class: "key"}, "获赞"),
								apivm.h("view", {class: "value"}, "13.5w")
							),
							apivm.h(
								"view",
								{class: "info-item"},
								apivm.h("view", {class: "key"}, "关注"),
								apivm.h("view", {class: "value"}, "123")
							),
							apivm.h(
								"view",
								{class: "info-item"},
								apivm.h("view", {class: "key"}, "粉丝"),
								apivm.h("view", {class: "value"}, "3.5w")
							)
						)
					),
					apivm.h("view", {class: "username"}, "老陈打码"),
					apivm.h("view", {class: "user_desc"}, "让学习编程更简单！")
				),
				apivm.h(
					"view",
					{class: "works"},
					apivm.h("view", {class: "title"}, "作品"),
					apivm.h(
						"view",
						{class: "work_list"},
						Object.entries(this.data.works).map(function(ref) {
							var index$1 = ref[0];
							var work = ref[1];
							return apivm.h(
								"view",
								{class: "work_item"},
								apivm.h("image", {src: work.poster}),
								apivm.h(
									"view",
									{class: "info"},
									apivm.h("image", {src: "../../image/pause_border.png"}),
									apivm.h("view", {class: "num"}, work.playnum)
								)
							);
						})
					)
				),
				apivm.h("tabbar", {active: "me"})
			);
		};

		return Me;
	})(Component);
	apivm.define("me", Me);
	apivm.render(apivm.h("me", null), "body");
})();

	window['createApp'] = function() {
		apivm.$_start();
	}
	return avm;
}